#pragma once


/********************************************************************
	created:	2007/03/08
	file base:	AnyView
	author:		
	purpose:  Views	Layer
*********************************************************************/


class Handle_V3d_View;
class CAnyDocument;
class TopoDS_Shape;
class CEditorMgr;
class CMenuContext;
class CRenderEngine;
class CSketchPlane;

class GEOMDBAPI CAnyView
{
public:
	CAnyView();
	virtual ~CAnyView(void);
	virtual bool Initialize(HWND hWnd, CAnyDocument* pAnyDoc);

	HWND GetOwnerWnd() const;
	CEditorMgr* GetEditorMgr(void);
	CAnyDocument* GetDocument(void);
	CRenderEngine* GetRender(void);
	void SendMessage(UINT message, WPARAM wParam, LPARAM lParam);

	void Redraw(void);

	void Resize(void);

	// transform
	void Zoom(long x, long y, long cx, long cy);
	void Pan(long x, long y);
	void StartRotation(long x, long y);
	void Rotation(long x, long y);
	void SetProj(UINT nProj);

	// compute
	void ConvertToGrid(int x, int y, gp_Pnt& point);
	void Convert(int x, int y, const gp_Pnt& location, gp_Pnt& point);
	void Convert(int x, int y, const gp_Pln& plane, gp_Pnt& point);

	// plane
	const gp_Dir& CurPlaneNormal(void);
	void UpdatePlane(CSketchPlane* pPlane);
public:
	Handle_V3d_View& GetInternalView(){return m_OccView;}
protected:
	
	Handle_V3d_View m_OccView;
	HWND	m_hOwnerWnd;
	CAnyDocument* m_pAnyDoc;
	CEditorMgr*		m_pEditorMgr;
	CSketchPlane*	m_pSketchPlane;
	CRenderEngine*  m_pRender;
};
